#httppatch.py
from SimpleHTTPServer import SimpleHTTPRequestHandler

send_head = SimpleHTTPRequestHandler.send_head

def new_send_head(*a, **kw):
    print 'new_send_head', a, kw
    f = send_head(*a, **kw)
    return f and open(f.name, 'rb')

SimpleHTTPRequestHandler.send_head = new_send_head